2716b68a7da1650f8bf9b6ab3e03749ea35751e2,src/main/java/com/ociweb/pronghorn/network/SSLEngineWrapStage.java,SSLEngineWrapStage,run,#,67
Before Change
PipeReader.tryReadFragment(plainContent[i]);
PipeReader.releaseReadLock(plainContent[i]);
if (--shutdownCount<=0) {
requestShutdown();
break;
}
}
After Change
} catch (Throwable t) {
t.printStackTrace();
requestShutdown();
System.exit(0);
return;
}
/////////////////////////////////////
//close the connection logic
//if connection is open we must finish the handshake.
////////////////////////////////////
if (PipeWriter.hasRoomForFragmentOfSize(targetPipe, SIZE_HANDSHAKE_AND_DISCONNECT)
&& PipeReader.peekMsg(sourcePipe, NetPayloadSchema.MSG_DISCONNECT_203)) {
//logger.info("WRAP FOUND DISCONNECT MESSAGE A server:"+isServer);
PipeReader.tryReadFragment(sourcePipe);
long connectionId = PipeReader.readLong(sourcePipe, NetPayloadSchema.MSG_DISCONNECT_203_FIELD_CONNECTIONID_201);
SSLConnection connection = ccm.get(connectionId, groupId);
if (null!=connection) {
assert(connection.isDisconnecting()) : "should only receive disconnect messages on connections which are disconnecting.";
SSLUtil.handShakeWrapIfNeeded(connection, targetPipe, secureBuffers[i], isServer);
}
PipeWriter.tryWriteFragment(targetPipe, NetPayloadSchema.MSG_DISCONNECT_203);
PipeWriter.writeLong(targetPipe, NetPayloadSchema.MSG_DISCONNECT_203_FIELD_CONNECTIONID_201, connectionId);
PipeWriter.publishWrites(targetPipe);
PipeReader.releaseReadLock(sourcePipe);
}
///////////////////////////
//shutdown this stage logic
///////////////////////////
if (PipeReader.peekMsg(sourcePipe, -1)) {
PipeReader.tryReadFragment(sourcePipe);
PipeReader.releaseReadLock(sourcePipe);
if (--shutdownCount<=0) {
System.err.println("shutdown SSLEngineWrap");
requestShutdown();
break;
}
}
}
} while (didWork && shutdownCount>0);//only exit if we pass over all pipes and there is no work to do.
totalNS += System.nanoTime()-start;